/*
**events.h**
Author:songwei@bingshan.com
Version:0.3
Copyright Bingshan Guardian 2004. All rights reserved.
*/

#define NOTIFY_KEY_EVENT(e,k,t){\
	e.DATA.keyUp.chr = k;\
	e.eType = t;\
	SetEvent(&e);\
	}
#define NOTIFY_COMM_EVENT(e,f,err){\
	e.DATA.rmtUpdate.func_code = f;\
	e.DATA.rmtUpdate.error_code = err;\
	e.eType = rmtUpdateEvent;\
	SetEvent(&e);\
	}

typedef enum{
  nilEvent=0,
  keyUpEvent,   //new
  keyDownEvent,
  keyRepeatEvent,
  keyRepeatLongEvent,
  rmtUpdateEvent,
} eventsEnum;



struct _KeyDownEventType{
  unsigned char chr;
  unsigned int keyCode;
  unsigned int modifiers;
};

struct _RemoteUpdateEventType{
  unsigned int reg;
  int value;
};

typedef struct TEvent{
  eventsEnum eType;

  union {
	struct _KeyDownEventType keyDown;
	struct _KeyDownEventType keyUp;
	struct{
	unsigned char func_code;
	unsigned char error_code;
	}rmtUpdate;
  }DATA; 
}TEvent;



#define Key_Up                0
#define Key_Down                1
#define Key_DSwitch             2
#define Key_Set                 3
#define Key_CSwitch             4


#define KEY_ENTER               0
#define KEY_RELEASE             1


#define KEY_NUM              5














extern void SetEvent(TEvent *event);
extern TEvent * GetEvent(void);

extern u8	Update_Key_Status( u8 KeyValue);

